package org.uncas.homepage.client;

import org.uncas.homepage.client.widgets.Container;
import org.uncas.homepage.client.widgets.PicasaAlbumWidget;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class MainPage implements EntryPoint {

	public void onModuleLoad() {
//		TabBar tabbar = new TabBar();
//		tabbar.addTab("egy");
//		tabbar.addTab("ketto");

		final TabPanel tabPanel = new TabPanel();
		tabPanel.add(createMainPage(),"NEWS");
		tabPanel.add(new HTML("two"),"GALLERY");
		tabPanel.setWidth("100%");
		tabPanel.setHeight("100%");
		tabPanel.selectTab(0);
		
	    final Button button = new Button("Don't click me");
	    final Label label = new Label();

	    button.addClickListener(new ClickListener() {
	      public void onClick(Widget sender) {
	        if (label.getText().equals(""))
	          label.setText("I said don't click me!");
	        else
	          label.setText("");
	      }
	    });

	    // Assume that the host HTML has elements defined whose
	    // IDs are "slot1", "slot2".  In a real app, you probably would not want
	    // to hard-code IDs.  Instead, you could, for example, search for all 
	    // elements with a particular CSS class and replace them with widgets.
	    //
	    RootPanel.get().add(tabPanel);
//	    RootPanel.get("slot1").add(button);
//	    RootPanel.get("slot2").add(label);
	}

	private VerticalPanel createMainPage() {
		VerticalPanel vp = new VerticalPanel();
		PicasaAlbumWidget paw = new PicasaAlbumWidget(3);
		vp.add(paw);
		vp.add(new Container("Caption"));
//		vp.setPixelSize(100, 100);
//		vp.add(new HTML("Kozepso"));
//		vp.setWidth("100px");
//		vp.setHeight("100px");
		
//		vp.add(new HTML("Also"));
		return vp;
	}

}
